package com.demo2do.fms.admin.dao.data;

import java.util.List;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Execute;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.demo2do.fms.entity.data.cost.DefaultOilType;

/**
 * 
 * @author Wy
 *
 */
@Dao("hibernate")
public interface DefaultOilTypeDao {
	
	/**
	 * @param orgIds
	 * @return
	 */
	@Query("SELECT COUNT(*) FROM DefaultOilType WHERE orgId IN (:orgIds)")
    public int count(@Variable("orgIds") List<Long> orgIds);
    
    /**
     * @param orgIds
     * @return
     */
    @Query("FROM DefaultOilType WHERE orgId IN (:orgIds) ORDER BY orgId ASC")
    public List<DefaultOilType> list(@Variable("orgIds") List<Long> orgIds);
    
    /**
     * @param orgId
     * @param oilTypeId
     */
    @Execute("UPDATE DefaultOilType SET oilTypeId = :oilTypeId WHERE orgId = :orgId")
    public void update(@Variable("orgId") Long orgId, @Variable("oilTypeId") Long oilTypeId);

}
